﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Wpf.Ui.Controls;

namespace ClientAppraise.Controls;

public class ZxCard : Card
{

    /// <summary>
    /// Property for <see cref="Footer"/>.
    /// </summary>
    public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
        nameof(Header),
        typeof(object),
        typeof(ZxCard),
        new PropertyMetadata(null, HeaderChangedCallback)
    );

    /// <summary>
    /// Property for <see cref="HasFooter"/>.
    /// </summary>
    public static readonly DependencyProperty HasHeaderProperty = DependencyProperty.Register(
        nameof(HasHeader),
        typeof(bool),
        typeof(ZxCard),
        new PropertyMetadata(false)
    );


    public object Header
    {
        get => GetValue(HeaderProperty);
        set => SetValue(HeaderProperty, value);
    }

    public bool HasHeader
    {
        get => (bool)GetValue(HasHeaderProperty);
        set => SetValue(HasHeaderProperty, value);
    }


    private static void HeaderChangedCallback( DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        if (d is not ZxCard control)
            return;

        control.SetValue(HasHeaderProperty, HeaderProperty != null);
    }



}
